To: OpenDoc Development Framework Discussion List, ODF-Interest@CILabs.
Harald Stegavik wrote:
>I want the (draw-based container) to draw lines between
>these ODParts (not wrappers), but have problems in finding
>their bounding rects/positions in the containing part.
>I'm shure there is a easy solution to this, but I'm somehow
>getting to close and messing things up (not having the complete
>picture of the graphical model of ODF+OD, which is wery well
>documented indeed).
I've done something similar with ODFDraw. Note that the embedded ODPart is represented by CProxyShape (its not clear if you do know this).
When a line's end point lands anywhere inside the CProxyShape's bounds (using its hit detection method), I determine the centre of the proxy shape and change the line end point to point to the centre; the centering is just a cosmetic thing that I need to achieve though. I then request that the line shape be moved under the proxy shape (methods for this are against the FW_CPart specialisation I think). This gives the visual appearance of the line being drawn to the edge of the embedded part.